package com.bw.controller;

import com.bw.entity.TbAdm;
import com.bw.entity.TbUserTem;
import com.bw.entity.vo.UserTemVo;
import com.bw.service.UserTemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class UserTemController {
    @Autowired
    private UserTemService userTemService;
    //用户组列表
    @GetMapping("usertemlist")
    List<UserTemVo> usertemlist(@RequestParam("mohu")String mohu){
        return userTemService.usertemlist(mohu);
    }
    //批量删除
    @PostMapping("temdel")
    String[] del(@RequestParam("id") String id){
        return userTemService.temdel(id);
    }
    //添加
    @PostMapping("temadd")
    TbUserTem temadd(@RequestBody TbUserTem userTem){
        return userTemService.temadd(userTem);
    }
    //修改
    @PostMapping("updUserList")
    TbUserTem updUserList(@RequestBody TbUserTem userTem){
        return userTemService.updUserList(userTem);
    }
    //回显
    @GetMapping("findByUserId")
    TbUserTem findByUserId(@RequestParam("id") int id){
        return userTemService.findByUserId(id);
    }
}
